﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace VSM
{
    public partial class DisplayKPI : System.Web.UI.Page
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void Page_Load(object sender, EventArgs e)
        {
          
            try
            {
                if (!IsPostBack)
                {
                    DataTable dtKPI = new DataTable("KPI");
                    dtKPI.Columns.Add("No");
                    dtKPI.Columns.Add("Group");
                    dtKPI.Columns.Add("Item");
                    dtKPI.Columns.Add("FromPoint");
                    dtKPI.Columns.Add("ToPoint");
                    dtKPI.Columns.Add("Description");

                    //
                    DataRow dr = dtKPI.NewRow();
                    dr["No"] = 0;
                    dr["Group"] = "Trưng bày Note 3";
                    dr["Item"] = "Kệ trưng bày";
                    dr["FromPoint"] = 1;
                    dr["ToPoint"] = 10;
                    dr["Description"] = string.Empty;
                    dtKPI.Rows.Add(dr);

                    dr = dtKPI.NewRow();
                    dr["No"] = 1;
                    dr["Group"] = "Trưng bày Note 3";
                    dr["Item"] = "Vị trí";
                    dr["FromPoint"] = 1;
                    dr["ToPoint"] = 10;
                    dr["Description"] = string.Empty;
                    dtKPI.Rows.Add(dr);

                    dr = dtKPI.NewRow();
                    dr["No"] = 2;
                    dr["Group"] = "Trưng bày Note 3";
                    dr["Item"] = "Sản phẩm";
                    dr["FromPoint"] = 1;
                    dr["ToPoint"] = 10;
                    dr["Description"] = string.Empty;
                    dtKPI.Rows.Add(dr);

                    dr = dtKPI.NewRow();
                    dr["No"] = 3;
                    dr["Group"] = "Trưng bày Note 3";
                    dr["Item"] = "Thời gian";
                    dr["FromPoint"] = 1;
                    dr["ToPoint"] = 10;
                    dr["Description"] = string.Empty;
                    dtKPI.Rows.Add(dr);

                    grvItem.DataSource = dtKPI;
                    grvItem.DataBind();

                }
            }
            catch (Exception ex)
            {
                string alert = "alert('Error:" + ex.Message.Replace('\'', ' ') + " ');";
                ScriptManager.RegisterClientScriptBlock(Page, this.GetType(), "CallJS", alert, true);
            }
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void grvSearchResult_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "MouseEvents(this, event)");
                e.Row.Attributes.Add("onmouseout", "MouseEvents(this, event)");
                e.Row.Attributes["style"] = "cursor:pointer";
            }
        }

 
        /// <summary>
        /// 
        /// </summary>
        /// <param name="e"></param>
        protected override void OnLoadComplete(EventArgs e)
        {
            try
            {
                base.OnLoadComplete(e);
                if (this.Request["__EVENTARGUMENT"] != null && this.Request["__EVENTARGUMENT"].ToString() != "")
                {
                    
                }
            }
            catch (Exception ex)
            {
                
            }
        }

    }
}